package com.example.sms.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.sms.entity.Teacher;
import com.example.sms.entity.dto.RegisterDTO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface TeacherMapper extends BaseMapper<Teacher> {
    @Select("select count(1) from teacher where username = #{username} and password = #{password}")
    Teacher selectByUsernameAndPassword(String username, String password);
    @Insert("insert into teacher(username,password,email,phone,gender,name)" +
            " values" +
            "(#{username},#{password},#{email},#{phone},#{gender},#{name})")
    Integer insert(RegisterDTO registerDTO);

    Integer addCourse(Integer teacherId, Integer courseId);

    Integer addToTeacherCourse(Integer teacherId, Integer courseId);

    Integer delStudent(Integer teacherId, Integer studentId);
@Select("select count(1) from teacher where username = #{username} and password = #{password}")
    boolean checkByUsernameAndPassword(String username, String password);
}
